#include "absl/strings/str_cat.h"
#include "gflags/gflags.h"
#include <absl/strings/string_view.h>
#include <gflags/gflags_declare.h>
#include <iostream>
#include <ostream>

#define GLOG_CUSTOM_PREFIX_SUPPORT 1
#include "glog/logging.h"

#include "helper/helper.h"

DEFINE_string(name, "", "name");
DEFINE_bool(enable_name, false, "enable_name");

// void cb(std::ostream&s, const LogMessageInfo& l, void*)
// {

// }

int main(int argc, char *argv[]) {

  helper_print();

  for (int i = 0; i < argc; ++i) {
    std::cout << "argc: " << argc << ", argv: " << argv[i] << std::endl;
  }
  gflags::ParseCommandLineFlags(&argc, &argv, true);
  for (int i = 0; i < argc; ++i) {
    std::cout << "argc: " << argc << ", argv: " << argv[i] << std::endl;
  }
  FLAGS_enable_name = false;
  std::cout << "FLAGS_name: " << FLAGS_name
            << "FLAGS_enable_name: " << FLAGS_enable_name << std::endl;

  google::InitGoogleLogging(argv[0]);
  LOG(ERROR) << "Found " << FLAGS_name << " cookies";

  CHECK(FLAGS_enable_name);

  std::string name = "Bazel";
  std::string msg = absl::StrCat("Hello, ", name, " with Abseil!");
  absl::string_view s;
  if (s.empty()) {
    s = "hello absl";
    std::cout << s << std::endl;
  }
  s.compare(s);
  std::cout << msg << std::endl;
  return 0;
}
